package com.dongwq

import groovy.xml.MarkupBuilder;

class ResourceTagLib {

	static namespace = "r"
	
	
	def css3buttonsResource = { attrs, body->
		def dir = "resource/css3buttons/css"
		
		def sw = new StringWriter();
		def html = new MarkupBuilder(sw)
		
		html.link(rel:'stylesheet', href: g.resource('dir':dir, file:'reset.css'))
		html.link(rel:'stylesheet', href: g.resource('dir':dir, file:'css3buttons.css'))
		
		out << sw
	}
	
	def kindeditorResource = { attrs, body->
		def dir = "resource/kindeditor"
		
		def sw = new StringWriter();
		def html = new MarkupBuilder(sw)
		
		// html.link(rel:'stylesheet', href: g.resource('dir':dir, file:'reset.css'))
		html.script(type:'text/javascript', charset:'utf-8',  src: g.resource('dir':dir, file:'kindeditor.js'), '')
		
		out << sw
	}
}
